#!/bin/sh

source /usr/local/sccli/functions
INPUTFILE=/usr/local/sccli/clients
OUTPUTFILE=/etc/dhcpd.reservations

#BEGIN DESCRIPTION
#DHCP, ferramenta interna de concessão de IPs
#END DESCRIPTION


case $1 in

	mount)

	echo gerando arquivos de dhcp

	while read LINE;
	do
	

	#dhcp-host=00:1e:90:d4:af:71,10.0.0.4,infinite #phenom
	echo dhcp-host=$(field mac),$(field ip),infinite '#'$(field name)


	done < $INPUTFILE > $OUTPUTFILE

	;;
	
	reload)
	
	echo "<br><pre>"
	/etc/rc.d/rc.dnsmasq
	echo "</pre>"
esac



